﻿Public Class AppSettings
    ''' <summary>
    ''' Function to download a file from URL and save it to local drive
    ''' </summary>
    ''' <param name="_URL">URL address to download file</param>
    Public Sub DownloadFile(ByVal _URL As String, ByVal _SaveAs As String)
        Try
            Dim _WebClient As New System.Net.WebClient()
            ' Downloads the resource with the specified URI to a local file.
            _WebClient.DownloadFile(_URL, _SaveAs)
        Catch _Exception As Exception
            ' Error
            Console.WriteLine("Exception caught in process: {0}", _Exception.ToString())
        End Try
    End Sub

    Private Sub AppSettings_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        AdminPassTxtBox.Text = My.Settings.AdminPass


    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        My.Settings.AdminPass = AdminPassTxtBox.Text
        My.Settings.Save()


    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles DL_Test.Click
        'http://files.gpg4win.org/gpg4win-2.2.1.exe
        DownloadFile("http://support.hasla.org.uk/HaslaTeamviewer.exe", "c:\HelpME.exe")
    End Sub

    Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click

    End Sub
End Class